<template>
	<view>
		<view class="b1">
			<view class="title">热门职位</view>
			<view class="content clearfix">
				<view class="item" v-for="(item,index) in dataset" :key="index" @click="jumpTo(item.word)">
					{{ item.word }}
				</view>
				<view class="item more" @click="goto('/views/JobList')">更多</view>
				<view class="clear"></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'HotOne',
		props: ['dataset'],
		methods: {
			jumpTo(keyword) {
				this.$emit('jumpTo', {
					keyword
				})
			},
			goto(path) {
				uni.navigateTo({
					url: path
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.b1 {
		.content {
			.item {
				&.more {
					color: #1787fb;
				}

				&:nth-of-type(4n) {
					margin-right: 0;
				}

				float: left;
				width: 154rpx;
				padding: 12rpx 10rpx;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				font-size: 26rpx;
				color: #666666;
				text-align: center;
				margin: 0 20rpx 20rpx 0;
				border: 2rpx solid #f5f5f5;
				border-radius: 70rpx;
			}

			width: 100%;
			padding: 0 30rpx 0;
		}

		.title {
			.more {
				&::after {
					position: absolute;
					right: 4rpx;
					top: 50%;
					width: 12rpx;
					height: 12rpx;
					margin-top: -6rpx;
					border-top: 2rpx solid #999999;
					border-right: 2rpx solid #999999;
					transform: rotate(45deg);
					content: " ";
				}

				position: absolute;
				right: 30rpx;
				top: 50%;
				transform: translate(0, -50%);
				font-size: 24rpx;
				color: #999999;
				line-height:normal;
				padding: 2rpx 22rpx 2rpx 0;
			}

			position: relative;
			font-size: 34rpx;
			color: #333333;
			padding: 25rpx 20rpx;
		}

		width: 100%;
		background-color: #ffffff;
		margin-bottom: 18rpx;
	}
</style>
